<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Range (Apache Commons Lang 3.3.2 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="Range (Apache Commons Lang 3.3.2 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Range.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/commons/lang3/RandomUtils.html" title="class in org.apache.commons.lang3"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/commons/lang3/SerializationException.html" title="class in org.apache.commons.lang3"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/lang3/Range.html" target="_top">Frames</a></li>
<li><a href="Range.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.lang3</div>
<h2 title="Class Range" class="title">Class Range&lt;T&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.lang3.Range&lt;T&gt;</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
</dl>
<hr>
<br>
<pre>public final class <span class="strong">Range&lt;T&gt;</span>
extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block"><p>An immutable range of objects from a minimum to maximum point inclusive.</p>
 
 <p>The objects need to either be implementations of <code>Comparable</code>
 or you need to supply a <code>Comparator</code>. </p>

 <p>#ThreadSafe# if the objects and comparator are thread-safe</p></div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>3.0</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: Range.java 1565243 2014-02-06 13:37:12Z sebb $</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../serialized-form.html#org.apache.commons.lang3.Range">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;T extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;T&gt;&gt;&nbsp;<br><a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#between(T, T)">between</a></strong>(T&nbsp;fromInclusive,
       T&nbsp;toInclusive)</code>
<div class="block">Obtains a range with the specified minimum and maximum values (both inclusive).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#between(T, T, java.util.Comparator)">between</a></strong>(T&nbsp;fromInclusive,
       T&nbsp;toInclusive,
       <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator)</code>
<div class="block">Obtains a range with the specified minimum and maximum values (both inclusive).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#contains(T)">contains</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</code>
<div class="block">Checks whether the specified element occurs within this range.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#containsRange(org.apache.commons.lang3.Range)">containsRange</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;otherRange)</code>
<div class="block">Checks whether this range contains all the elements of the specified range.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#elementCompareTo(T)">elementCompareTo</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</code>
<div class="block">Checks where the specified element occurs relative to this range.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#equals(java.lang.Object)">equals</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Compares this range to another object to test if they are equal.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#getComparator()">getComparator</a></strong>()</code>
<div class="block">Gets the comparator being used to determine if objects are within the range.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#getMaximum()">getMaximum</a></strong>()</code>
<div class="block">Gets the maximum value in this range.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#getMinimum()">getMinimum</a></strong>()</code>
<div class="block">Gets the minimum value in this range.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#hashCode()">hashCode</a></strong>()</code>
<div class="block">Gets a suitable hash code for the range.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#intersectionWith(org.apache.commons.lang3.Range)">intersectionWith</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;other)</code>
<div class="block">Calculate the intersection of <code>this</code> and an overlapping Range.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;T extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;T&gt;&gt;&nbsp;<br><a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#is(T)">is</a></strong>(T&nbsp;element)</code>
<div class="block">Obtains a range using the specified element as both the minimum
 and maximum in this range.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#is(T, java.util.Comparator)">is</a></strong>(T&nbsp;element,
  <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator)</code>
<div class="block">Obtains a range using the specified element as both the minimum
 and maximum in this range.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#isAfter(T)">isAfter</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</code>
<div class="block">Checks whether this range is after the specified element.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#isAfterRange(org.apache.commons.lang3.Range)">isAfterRange</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;otherRange)</code>
<div class="block">Checks whether this range is completely after the specified range.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#isBefore(T)">isBefore</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</code>
<div class="block">Checks whether this range is before the specified element.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#isBeforeRange(org.apache.commons.lang3.Range)">isBeforeRange</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;otherRange)</code>
<div class="block">Checks whether this range is completely before the specified range.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#isEndedBy(T)">isEndedBy</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</code>
<div class="block">Checks whether this range starts with the specified element.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#isNaturalOrdering()">isNaturalOrdering</a></strong>()</code>
<div class="block">Whether or not the Range is using the natural ordering of the elements.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#isOverlappedBy(org.apache.commons.lang3.Range)">isOverlappedBy</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;otherRange)</code>
<div class="block">Checks whether this range is overlapped by the specified range.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#isStartedBy(T)">isStartedBy</a></strong>(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</code>
<div class="block">Checks whether this range starts with the specified element.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#toString()">toString</a></strong>()</code>
<div class="block">Gets the range as a <code>String</code>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/Range.html#toString(java.lang.String)">toString</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format)</code>
<div class="block">Formats the receiver using the given format.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="is(java.lang.Comparable)">
<!--   -->
</a><a name="is(T)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>is</h4>
<pre>public static&nbsp;&lt;T extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;T&gt;&gt;&nbsp;<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;T&gt;&nbsp;is(T&nbsp;element)</pre>
<div class="block"><p>Obtains a range using the specified element as both the minimum
 and maximum in this range.</p>
 
 <p>The range uses the natural ordering of the elements to determine where
 values lie in the range.</p></div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - the type of the elements in this range</dd><dt><span class="strong">Parameters:</span></dt><dd><code>element</code> - the value to use for this range, not null</dd>
<dt><span class="strong">Returns:</span></dt><dd>the range object, not null</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the element is null</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the element is not <code>Comparable</code></dd></dl>
</li>
</ul>
<a name="is(java.lang.Object,java.util.Comparator)">
<!--   -->
</a><a name="is(T, java.util.Comparator)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>is</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;T&gt;&nbsp;is(T&nbsp;element,
              <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator)</pre>
<div class="block"><p>Obtains a range using the specified element as both the minimum
 and maximum in this range.</p>
 
 <p>The range uses the specified <code>Comparator</code> to determine where
 values lie in the range.</p></div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - the type of the elements in this range</dd><dt><span class="strong">Parameters:</span></dt><dd><code>element</code> - the value to use for this range, must not be <code>null</code></dd><dd><code>comparator</code> - the comparator to be used, null for natural ordering</dd>
<dt><span class="strong">Returns:</span></dt><dd>the range object, not null</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the element is null</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if using natural ordering and the elements are not <code>Comparable</code></dd></dl>
</li>
</ul>
<a name="between(java.lang.Comparable,java.lang.Comparable)">
<!--   -->
</a><a name="between(T, T)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>between</h4>
<pre>public static&nbsp;&lt;T extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;T&gt;&gt;&nbsp;<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;T&gt;&nbsp;between(T&nbsp;fromInclusive,
                                         T&nbsp;toInclusive)</pre>
<div class="block"><p>Obtains a range with the specified minimum and maximum values (both inclusive).</p>
 
 <p>The range uses the natural ordering of the elements to determine where
 values lie in the range.</p>

 <p>The arguments may be passed in the order (min,max) or (max,min).
 The getMinimum and getMaximum methods will return the correct values.</p></div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - the type of the elements in this range</dd><dt><span class="strong">Parameters:</span></dt><dd><code>fromInclusive</code> - the first value that defines the edge of the range, inclusive</dd><dd><code>toInclusive</code> - the second value that defines the edge of the range, inclusive</dd>
<dt><span class="strong">Returns:</span></dt><dd>the range object, not null</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if either element is null</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the elements are not <code>Comparable</code></dd></dl>
</li>
</ul>
<a name="between(java.lang.Object,java.lang.Object,java.util.Comparator)">
<!--   -->
</a><a name="between(T, T, java.util.Comparator)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>between</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;T&gt;&nbsp;between(T&nbsp;fromInclusive,
                   T&nbsp;toInclusive,
                   <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator)</pre>
<div class="block"><p>Obtains a range with the specified minimum and maximum values (both inclusive).</p>
 
 <p>The range uses the specified <code>Comparator</code> to determine where
 values lie in the range.</p>

 <p>The arguments may be passed in the order (min,max) or (max,min).
 The getMinimum and getMaximum methods will return the correct values.</p></div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - the type of the elements in this range</dd><dt><span class="strong">Parameters:</span></dt><dd><code>fromInclusive</code> - the first value that defines the edge of the range, inclusive</dd><dd><code>toInclusive</code> - the second value that defines the edge of the range, inclusive</dd><dd><code>comparator</code> - the comparator to be used, null for natural ordering</dd>
<dt><span class="strong">Returns:</span></dt><dd>the range object, not null</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if either element is null</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if using natural ordering and the elements are not <code>Comparable</code></dd></dl>
</li>
</ul>
<a name="getMinimum()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMinimum</h4>
<pre>public&nbsp;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;getMinimum()</pre>
<div class="block"><p>Gets the minimum value in this range.</p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the minimum value in this range, not null</dd></dl>
</li>
</ul>
<a name="getMaximum()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaximum</h4>
<pre>public&nbsp;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;getMaximum()</pre>
<div class="block"><p>Gets the maximum value in this range.</p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the maximum value in this range, not null</dd></dl>
</li>
</ul>
<a name="getComparator()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getComparator</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;getComparator()</pre>
<div class="block"><p>Gets the comparator being used to determine if objects are within the range.</p>
 
 <p>Natural ordering uses an internal comparator implementation, thus this
 method never returns null. See <a href="../../../../org/apache/commons/lang3/Range.html#isNaturalOrdering()"><code>isNaturalOrdering()</code></a>.</p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the comparator being used, not null</dd></dl>
</li>
</ul>
<a name="isNaturalOrdering()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isNaturalOrdering</h4>
<pre>public&nbsp;boolean&nbsp;isNaturalOrdering()</pre>
<div class="block"><p>Whether or not the Range is using the natural ordering of the elements.</p>
 
 <p>Natural ordering uses an internal comparator implementation, thus this
 method is the only way to check if a null comparator was specified.</p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>true if using natural ordering</dd></dl>
</li>
</ul>
<a name="contains(java.lang.Object)">
<!--   -->
</a><a name="contains(T)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>contains</h4>
<pre>public&nbsp;boolean&nbsp;contains(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</pre>
<div class="block"><p>Checks whether the specified element occurs within this range.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>element</code> - the element to check for, null returns false</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the specified element occurs within this range</dd></dl>
</li>
</ul>
<a name="isAfter(java.lang.Object)">
<!--   -->
</a><a name="isAfter(T)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAfter</h4>
<pre>public&nbsp;boolean&nbsp;isAfter(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</pre>
<div class="block"><p>Checks whether this range is after the specified element.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>element</code> - the element to check for, null returns false</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if this range is entirely after the specified element</dd></dl>
</li>
</ul>
<a name="isStartedBy(java.lang.Object)">
<!--   -->
</a><a name="isStartedBy(T)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isStartedBy</h4>
<pre>public&nbsp;boolean&nbsp;isStartedBy(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</pre>
<div class="block"><p>Checks whether this range starts with the specified element.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>element</code> - the element to check for, null returns false</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the specified element occurs within this range</dd></dl>
</li>
</ul>
<a name="isEndedBy(java.lang.Object)">
<!--   -->
</a><a name="isEndedBy(T)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEndedBy</h4>
<pre>public&nbsp;boolean&nbsp;isEndedBy(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</pre>
<div class="block"><p>Checks whether this range starts with the specified element.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>element</code> - the element to check for, null returns false</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the specified element occurs within this range</dd></dl>
</li>
</ul>
<a name="isBefore(java.lang.Object)">
<!--   -->
</a><a name="isBefore(T)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isBefore</h4>
<pre>public&nbsp;boolean&nbsp;isBefore(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</pre>
<div class="block"><p>Checks whether this range is before the specified element.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>element</code> - the element to check for, null returns false</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if this range is entirely before the specified element</dd></dl>
</li>
</ul>
<a name="elementCompareTo(java.lang.Object)">
<!--   -->
</a><a name="elementCompareTo(T)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>elementCompareTo</h4>
<pre>public&nbsp;int&nbsp;elementCompareTo(<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&nbsp;element)</pre>
<div class="block"><p>Checks where the specified element occurs relative to this range.</p>
 
 <p>The API is reminiscent of the Comparable interface returning <code>-1</code> if
 the element is before the range, <code>0</code> if contained within the range and
 <code>1</code> if the element is after the range. </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>element</code> - the element to check for, not null</dd>
<dt><span class="strong">Returns:</span></dt><dd>-1, 0 or +1 depending on the element's location relative to the range</dd></dl>
</li>
</ul>
<a name="containsRange(org.apache.commons.lang3.Range)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>containsRange</h4>
<pre>public&nbsp;boolean&nbsp;containsRange(<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;otherRange)</pre>
<div class="block"><p>Checks whether this range contains all the elements of the specified range.</p>

 <p>This method may fail if the ranges have two different comparators or element types.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>otherRange</code> - the range to check, null returns false</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if this range contains the specified range</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang">RuntimeException</a></code> - if ranges cannot be compared</dd></dl>
</li>
</ul>
<a name="isAfterRange(org.apache.commons.lang3.Range)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAfterRange</h4>
<pre>public&nbsp;boolean&nbsp;isAfterRange(<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;otherRange)</pre>
<div class="block"><p>Checks whether this range is completely after the specified range.</p>

 <p>This method may fail if the ranges have two different comparators or element types.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>otherRange</code> - the range to check, null returns false</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if this range is completely after the specified range</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang">RuntimeException</a></code> - if ranges cannot be compared</dd></dl>
</li>
</ul>
<a name="isOverlappedBy(org.apache.commons.lang3.Range)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isOverlappedBy</h4>
<pre>public&nbsp;boolean&nbsp;isOverlappedBy(<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;otherRange)</pre>
<div class="block"><p>Checks whether this range is overlapped by the specified range.</p>
 
 <p>Two ranges overlap if there is at least one element in common.</p>

 <p>This method may fail if the ranges have two different comparators or element types.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>otherRange</code> - the range to test, null returns false</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the specified range overlaps with this
  range; otherwise, <code>false</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang">RuntimeException</a></code> - if ranges cannot be compared</dd></dl>
</li>
</ul>
<a name="isBeforeRange(org.apache.commons.lang3.Range)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isBeforeRange</h4>
<pre>public&nbsp;boolean&nbsp;isBeforeRange(<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;otherRange)</pre>
<div class="block"><p>Checks whether this range is completely before the specified range.</p>

 <p>This method may fail if the ranges have two different comparators or element types.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>otherRange</code> - the range to check, null returns false</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if this range is completely before the specified range</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang">RuntimeException</a></code> - if ranges cannot be compared</dd></dl>
</li>
</ul>
<a name="intersectionWith(org.apache.commons.lang3.Range)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>intersectionWith</h4>
<pre>public&nbsp;<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;intersectionWith(<a href="../../../../org/apache/commons/lang3/Range.html" title="class in org.apache.commons.lang3">Range</a>&lt;<a href="../../../../org/apache/commons/lang3/Range.html" title="type parameter in Range">T</a>&gt;&nbsp;other)</pre>
<div class="block">Calculate the intersection of <code>this</code> and an overlapping Range.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>other</code> - overlapping Range</dd>
<dt><span class="strong">Returns:</span></dt><dd>range representing the intersection of <code>this</code> and <code>other</code> (<code>this</code> if equal)</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>other</code> does not overlap <code>this</code></dd><dt><span class="strong">Since:</span></dt>
  <dd>3.0.1</dd></dl>
</li>
</ul>
<a name="equals(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public&nbsp;boolean&nbsp;equals(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block"><p>Compares this range to another object to test if they are equal.</p>.

 <p>To be equal, the minimum and maximum values must be equal, which
 ignores any differences in the comparator.</p></div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>obj</code> - the reference object with which to compare</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if this object is equal</dd></dl>
</li>
</ul>
<a name="hashCode()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public&nbsp;int&nbsp;hashCode()</pre>
<div class="block"><p>Gets a suitable hash code for the range.</p></div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>a hash code value for this object</dd></dl>
</li>
</ul>
<a name="toString()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
<div class="block"><p>Gets the range as a <code>String</code>.</p>

 <p>The format of the String is '[<i>min</i>..<i>max</i>]'.</p></div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>String</code> representation of this range</dd></dl>
</li>
</ul>
<a name="toString(java.lang.String)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format)</pre>
<div class="block"><p>Formats the receiver using the given format.</p>
 
 <p>This uses <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Formattable.html?is-external=true" title="class or interface in java.util"><code>Formattable</code></a> to perform the formatting. Three variables may
 be used to embed the minimum, maximum and comparator.
 Use <code>%1$s</code> for the minimum element, <code>%2$s</code> for the maximum element
 and <code>%3$s</code> for the comparator.
 The default format used by <code>toString()</code> is <code>[%1$s..%2$s]</code>.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>format</code> - the format string, optionally containing <code>%1$s</code>, <code>%2$s</code> and  <code>%3$s</code>, not null</dd>
<dt><span class="strong">Returns:</span></dt><dd>the formatted string, not null</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Range.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/commons/lang3/RandomUtils.html" title="class in org.apache.commons.lang3"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/commons/lang3/SerializationException.html" title="class in org.apache.commons.lang3"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/lang3/Range.html" target="_top">Frames</a></li>
<li><a href="Range.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2001&#x2013;2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
